package net.javastone.toolkit.robot.dingding.model;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * Created by sdliang on 2018/11/6.
 */
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class DingDingResponse {

  private int errcode;
  private String errmsg;

  public static final int CODE_ERROR = 300001;

  public static DingDingResponse OK = new DingDingResponse(0, "ok");

  /**
   * 不支持的事件
   *
   * @param msg
   * @return
   */
  public static DingDingResponse error(String msg) {
    return new DingDingResponse(CODE_ERROR, msg);
  }

}
